app.controller("z-reportTimeDetail-c", [ '$scope','$rootScope','$z-http','$sce','z-reportTimeDetail-s','z-dictionary-s','z-corporation-s','z-department-s','z-edit-menu-s','$filter',
		function($scope,$rootScope,$zhttp,$sce,Service,DictionaryService,CorporationService,DepartmentService,MenuService,$filter) {
		$scope.viewModel = {};
		$scope.viewModel.perPage = "10";
		$scope.viewModel.rowCount = "1";
		//查询页面名称
		MenuService.getMenuByUrl({url:'reportTimeDetail'},
		function(data){	
			$scope.viewModel.menuList=data;
		},function(error) {});
		// 获取本月第一天
		$scope.viewModel.reportStratDate = (new Date()).setDate(1);
		// 获取当前日期
		$scope.viewModel.reportEndDate = new Date();
        
		//转换字符串
        $scope.viewModel.trustAsHtml =function(value){
        	 return $sce.trustAsHtml(value);
        };
         
		//日期控件
		$scope.viewModel.dateOptions = {
				formatYear: 'yy',
			    startingDay: 1,
			    showWeeks:false
		};
		//日期控件
		$scope.viewModel.format = "yyyy/MM/dd";
		//日期启动开关
		$scope.viewModel.startDateOpened = false;
		$scope.viewModel.endDateOpened = false;
		//起止日期选择
		$scope.viewModel.startDateOpen = function($event) {
			$event.preventDefault();
			$event.stopPropagation();
			 $scope.viewModel.startDateOpened = !$scope.viewModel.startDateOpened;
		};
		//起止日期选择
		$scope.viewModel.endDateOpen = function($event) {
			$event.preventDefault();
			$event.stopPropagation();
			 $scope.viewModel.endDateOpened = !$scope.viewModel.endDateOpened;
		};
		
		$scope.viewModel.employeeIsSeparated=null;
		$scope.viewModel.regionType=null;
		$scope.viewModel.employeeNo=null;
		$scope.viewModel.roleName=null;
		$scope.viewModel.departmentList=[];
		$scope.viewModel.corporationList=[];
		$scope.viewModel.employeeList=[];
		$scope.viewModel.level=null;
		// 导出
		$scope.viewModel.exportData= function() {
        	$scope.viewModel.employeeList=[];
			if($scope.viewModel.employeeNo!=null){
				var employeeNoData = $scope.viewModel.employeeNo.split("\n");
				for(var i=0;i<employeeNoData.length;i++){
					$scope.viewModel.employeeList.push(employeeNoData[i]);
				}
			}
			$scope.viewModel.isLoading=true;
        	//导出
			Service.getExportReport({
				employeeList:$scope.viewModel.employeeList,
				employeeLevelList:$scope.viewModel.employeeLevelList,
				corporationList:$scope.viewModel.corporationList,
				departmentList:$scope.viewModel.departmentList,
				beginDate:$scope.viewModel.reportStratDate,
				endDate:$scope.viewModel.reportEndDate,
				isPage:"0",
			},
			function(data){
				$scope.viewModel.isLoading=false;
				window.location.href = data;
			},function(error) {
				$rootScope.alertError(error.fault.message);
				$scope.viewModel.isLoading=false;
			});
        };
		//下拉多选框长度
		$scope.multiSelectMaxHeight=300;
		//加载信息
		$scope.viewModel.bindSelectRegionTypeData = function(){
			//查询公司
			CorporationService.getCorporationList({
				fromDate:$scope.viewModel.reportEndDate,
			},
			function(data){
				var site = [];  
		        $.each(data, function(index, values) {  
		            site.push({  
		                label : "("+values.corporationCode+")"+values.corporationName,  
		                value : values.corporationCode  
		            });  
		        });  
		        $('#rtdCorporation').multiselect('dataprovider',site);
			},function(error) {
				
			});
		};
		$scope.viewModel.bindSelectRegionTypeData();
		
	
		/*******使用为下拉带勾选控件*********/
		//员工级别
		$('#rtdlevel').multiselect({
			includeSelectAllOption: true,
			enableFiltering: true,
			delimiterText: '; ',
            maxHeight: $scope.multiSelectMaxHeight
        });
		//公司
		$('#rtdCorporation').multiselect({
			includeSelectAllOption: true,
			enableFiltering: true,
			delimiterText: '; ',
            maxHeight: $scope.multiSelectMaxHeight
        });
		//公司选中事件
		$("#rtdCorporation").change(function(){  
			var value=$(this).val();
		    var data={};
		    data.corporationCodeList=value;
		    data.fromDate = $scope.viewModel.reportEndDate;
		    if(value==null){
		    	var site = [];  
		    	$('#rtdDepartmentName').multiselect('dataprovider',site);
		    	$scope.viewModel.departmentList=[];
		    }else{
		    	//查询部门
			    DepartmentService.getDepartmentListByCorporationCodeList(data,
				function(data){
			    	var site = [];  
			        $.each(data, function(index, values) {  
			            site.push({  
			                label : "("+values.departmentCode+")"+values.departmentName,  
			                value : values.departmentCode  
			            });  
			        });  
			        $('#rtdDepartmentName').multiselect('dataprovider',site);
				},function(error) {
					
				});
		    }
        });  
		
		//部门
		$('#rtdDepartmentName').multiselect({
			includeSelectAllOption: true,
			enableFiltering: true,
			delimiterText: '; ',
            maxHeight: $scope.multiSelectMaxHeight
        });
		
		//加载数据
		$scope.viewModel.bindData = function(){
			$scope.viewModel.employeeList=[];
			if($scope.viewModel.employeeNo!=null){
				var employeeNoData = $scope.viewModel.employeeNo.split("\n");
				for(var i=0;i<employeeNoData.length;i++){
					$scope.viewModel.employeeList.push(employeeNoData[i]);
				}
			}
			$scope.viewModel.isLoading=true;
			//获取基本信息
			Service.getReportAttendanceList({
				pageNo:$scope.viewModel.rowCount,
				pageCount:$scope.viewModel.perPage,
				beginDate:$scope.viewModel.reportStratDate,
				endDate:$scope.viewModel.reportEndDate,
				departmentList:$scope.viewModel.departmentList,
				corporationList:$scope.viewModel.corporationList,
				employeeList:$scope.viewModel.employeeList,
				employeeLevelList:$scope.viewModel.employeeLevelList,
			},
			function(data){
				$scope.viewModel.dataList = data.reportInfoList;
				$scope.viewModel.totalData = data.pageTotal;
				$scope.viewModel.isLoading=false;
			},function(error) {
				$scope.viewModel.isLoading=false;
			});
		};
		//$scope.viewModel.bindData();
		
		$scope.viewModel.ulShow = false;
		//表格按钮点击事件
		$scope.viewModel.reportButton = function(e){
			e.stopPropagation();
			if($scope.viewModel.ulShow == false){
				$(".reportUl").show();
				$scope.viewModel.ulShow = true;
			}else{
				$(".reportUl").hide();
				$scope.viewModel.ulShow = false;
			}
		};
		$(document).click(function(){
			$(".reportUl").hide();
			$scope.viewModel.ulShow = false;
		});
		$(".reportUl").click(function(event){
			 event.stopPropagation();
		});
		// 定义表格下拉数据
		$scope.viewModel.checkList = [{dicId:"1",dicName:"一级架构"},
		                              {dicId:"2",dicName:"二级架构"},
		                              {dicId:"3",dicName:"三级架构"},
		                              {dicId:"4",dicName:"四级架构"},
		                              {dicId:"56",dicName:"项目组"},
		                              {dicId:"5",dicName:"工号"},
		                              {dicId:"6",dicName:"中文名"},
		                              {dicId:"7",dicName:"英文名"},
		                              {dicId:"8",dicName:"岗位"},
		                              {dicId:"9",dicName:"入职日期"},
		                              {dicId:"10",dicName:"离职日期"},
		                              {dicId:"11",dicName:"应出勤天数"},
		                              {dicId:"13",dicName:"迟到次数"},
		                              {dicId:"15",dicName:"早退次数"},
		                              {dicId:"17",dicName:"旷工次数"},
		                              {dicId:"171",dicName:"补签次数"},
		                              {dicId:"18",dicName:"平日加班"},
		                              {dicId:"19",dicName:"双休加班"},
		                              {dicId:"20",dicName:"节日加班"},
		                              {dicId:"21",dicName:"年假"},
		                              {dicId:"22",dicName:"调休"},
		                              {dicId:"30",dicName:"事假"},
		                              {dicId:"29",dicName:"病假"},
		                              {dicId:"26",dicName:"婚假"},
		                              {dicId:"23",dicName:"产假"},
		                              {dicId:"24",dicName:"产检"},
		                              {dicId:"27",dicName:"陪护假"},
		                              {dicId:"28",dicName:"哺乳假"},
		                              {dicId:"25",dicName:"丧假"},
		                              {dicId:"31",dicName:"迟到次数累计"},
		                              {dicId:"32",dicName:"早退次数累计"},
		                              {dicId:"33",dicName:"旷工次数累计"},
		                              {dicId:"34",dicName:"平日加班累计"},
		                              {dicId:"35",dicName:"双休加班累计"},
		                              {dicId:"36",dicName:"节日加班累计"},
		                              {dicId:"37",dicName:"年假开始享受日期"},
		                              {dicId:"38",dicName:"可享受年假"},
		                              {dicId:"39",dicName:"已休年假"},
		                              {dicId:"40",dicName:"剩余年假"},
		                              {dicId:"41",dicName:"已休去年年假"},
		                              {dicId:"42",dicName:"可享受去年年假"},
		                              {dicId:"43",dicName:"已请调休累计"},
		                              {dicId:"44",dicName:"剩余调休累计"},
		                              {dicId:"45",dicName:"可休产假累计"},
		                              {dicId:"46",dicName:"已休产假累计"},
		                              {dicId:"47",dicName:"剩余产假累计"},
		                              {dicId:"48",dicName:"已休产检假累计"},
		                              {dicId:"49",dicName:"已休丧假累计"},
		                              {dicId:"50",dicName:"已休婚假累计"},
		                              {dicId:"51",dicName:"已休陪护假累计"},
		                              {dicId:"52",dicName:"已休哺乳假累计"},
		                              {dicId:"53",dicName:"已休病假累计"},
		                              {dicId:"54",dicName:"已休事假累计"},
		                              {dicId:"55",dicName:"备注"}];
		// 设置初始值
		$scope.viewModel.checkbox1 = true;
		$scope.viewModel.checkbox2 = true;
		$scope.viewModel.checkbox3 = true;
		$scope.viewModel.checkbox4 = true;
		$scope.viewModel.checkbox5 = true;
		$scope.viewModel.checkbox6 = true;
		$scope.viewModel.checkbox7 = true;
		$scope.viewModel.checkbox8 = true;
		$scope.viewModel.checkbox9 = true;
		$scope.viewModel.checkbox10 = true;
		$scope.viewModel.checkbox11 = true;
//		$scope.viewModel.checkbox12 = true;
		$scope.viewModel.checkbox13 = true;
//		$scope.viewModel.checkbox14 = true;
		$scope.viewModel.checkbox15 = true;
//		$scope.viewModel.checkbox16 = true;
		$scope.viewModel.checkbox17 = true;
		$scope.viewModel.checkbox171 = true;
		$scope.viewModel.checkbox18 = true;
		$scope.viewModel.checkbox19 = true;
		$scope.viewModel.checkbox20 = true;
		$scope.viewModel.checkbox21 = true;
		$scope.viewModel.checkbox22 = true;
		$scope.viewModel.checkbox23 = true;
		$scope.viewModel.checkbox24 = true;
		$scope.viewModel.checkbox25 = true;
		$scope.viewModel.checkbox26 = true;
		$scope.viewModel.checkbox27 = true;
		$scope.viewModel.checkbox28 = true;
		$scope.viewModel.checkbox29 = true;
		$scope.viewModel.checkbox30 = true;
		$scope.viewModel.checkbox31 = true;
		$scope.viewModel.checkbox32 = true;
		$scope.viewModel.checkbox33 = true;
		$scope.viewModel.checkbox34 = true;
		$scope.viewModel.checkbox35 = true;
		$scope.viewModel.checkbox36 = true;
		$scope.viewModel.checkbox37 = true;
		$scope.viewModel.checkbox38 = true;
		$scope.viewModel.checkbox39 = true;
		$scope.viewModel.checkbox40 = true;
		$scope.viewModel.checkbox41 = true;
		$scope.viewModel.checkbox42 = true;
		$scope.viewModel.checkbox43 = true;
		$scope.viewModel.checkbox44 = true;
		$scope.viewModel.checkbox45 = true;
		$scope.viewModel.checkbox46 = true;
		$scope.viewModel.checkbox47 = true;
		$scope.viewModel.checkbox48 = true;
		$scope.viewModel.checkbox49 = true;
		$scope.viewModel.checkbox50 = true;
		$scope.viewModel.checkbox51 = true;
		$scope.viewModel.checkbox52 = true;
		$scope.viewModel.checkbox53 = true;
		$scope.viewModel.checkbox54 = true;
		$scope.viewModel.checkbox55 = true;
		$scope.viewModel.checkbox56 = true;
		var x=document.getElementById('report-table').rows[0].cells;
		$scope.viewModel.checkbox = function(type){
			if(type == 1){
				if($scope.viewModel.checkbox1 == true){
					x[0].colSpan = x[0].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
						x[0].colSpan = x[0].colSpan * 1 + 1;
					}else{
						x[0].colSpan = x[0].colSpan;
						$("#report-table thead tr th:eq(0)").show();
					}
				}
				$scope.viewModel.checkbox1 = !$scope.viewModel.checkbox1;
				if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
					$("#report-table thead tr th:eq(0)").hide();
				}else{
					$("#report-table thead tr th:eq(0)").show();
				}
			}
			if(type == 2){
				if($scope.viewModel.checkbox2 == true){
					x[0].colSpan = x[0].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
						x[0].colSpan = x[0].colSpan * 1 + 1;
					}else{
						x[0].colSpan = x[0].colSpan;
						$("#report-table thead tr th:eq(0)").show();
					}
				}
				$scope.viewModel.checkbox2 = !$scope.viewModel.checkbox2;
				if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
					$("#report-table thead tr th:eq(0)").hide();
				}else{
					$("#report-table thead tr th:eq(0)").show();
				}
			}
			if(type == 3){
				if($scope.viewModel.checkbox3 == true){
					x[0].colSpan = x[0].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
						x[0].colSpan = x[0].colSpan * 1 + 1;
					}else{
						x[0].colSpan = x[0].colSpan;
						$("#report-table thead tr th:eq(0)").show();
					}
				}
				$scope.viewModel.checkbox3 = !$scope.viewModel.checkbox3;
				if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
					$("#report-table thead tr th:eq(0)").hide();
				}else{
					$("#report-table thead tr th:eq(0)").show();
				}
			}
			if(type == 4){
				if($scope.viewModel.checkbox4 == true){
					x[0].colSpan = x[0].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
						x[0].colSpan = x[0].colSpan * 1 + 1;
					}else{
						x[0].colSpan = x[0].colSpan;
						$("#report-table thead tr th:eq(0)").show();
					}
				}
				$scope.viewModel.checkbox4 = !$scope.viewModel.checkbox4;
				if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
					$("#report-table thead tr th:eq(0)").hide();
				}else{
					$("#report-table thead tr th:eq(0)").show();
				}
			}
			if(type == 5){
				if($scope.viewModel.checkbox5 == true){
					x[0].colSpan = x[0].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
						x[0].colSpan = x[0].colSpan * 1 + 1;
					}else{
						x[0].colSpan = x[0].colSpan;
						$("#report-table thead tr th:eq(0)").show();
					}
				}
				$scope.viewModel.checkbox5 = !$scope.viewModel.checkbox5;
				if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
					$("#report-table thead tr th:eq(0)").hide();
				}else{
					$("#report-table thead tr th:eq(0)").show();
				}
			}
			if(type == 6){
				if($scope.viewModel.checkbox6 == true){
					x[0].colSpan = x[0].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
						x[0].colSpan = x[0].colSpan * 1 + 1;
					}else{
						x[0].colSpan = x[0].colSpan;
						$("#report-table thead tr th:eq(0)").show();
					}
				}
				$scope.viewModel.checkbox6 = !$scope.viewModel.checkbox6;
				if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
					$("#report-table thead tr th:eq(0)").hide();
				}else{
					$("#report-table thead tr th:eq(0)").show();
				}
			}
			if(type == 7){
				if($scope.viewModel.checkbox7 == true){
					x[0].colSpan = x[0].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
						x[0].colSpan = x[0].colSpan * 1 + 1;
					}else{
						x[0].colSpan = x[0].colSpan;
						$("#report-table thead tr th:eq(0)").show();
					}
				}
				$scope.viewModel.checkbox7 = !$scope.viewModel.checkbox7;
				if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
					$("#report-table thead tr th:eq(0)").hide();
				}else{
					$("#report-table thead tr th:eq(0)").show();
				}
			}
			if(type == 8){
				if($scope.viewModel.checkbox8 == true){
					x[0].colSpan = x[0].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
						x[0].colSpan = x[0].colSpan * 1 + 1;
					}else{
						x[0].colSpan = x[0].colSpan;
						$("#report-table thead tr th:eq(0)").show();
					}
				}
				$scope.viewModel.checkbox8 = !$scope.viewModel.checkbox8;
				if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
					$("#report-table thead tr th:eq(0)").hide();
				}else{
					$("#report-table thead tr th:eq(0)").show();
				}
			}
			if(type == 9){
				if($scope.viewModel.checkbox9 == true){
					x[0].colSpan = x[0].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
						x[0].colSpan = x[0].colSpan * 1 + 1;
					}else{
						x[0].colSpan = x[0].colSpan;
						$("#report-table thead tr th:eq(0)").show();
					}
				}
				$scope.viewModel.checkbox9 = !$scope.viewModel.checkbox9;
				if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
					$("#report-table thead tr th:eq(0)").hide();
				}else{
					$("#report-table thead tr th:eq(0)").show();
				}
			}
			if(type == 10){
				if($scope.viewModel.checkbox10 == true){
					x[0].colSpan = x[0].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
						x[0].colSpan = x[0].colSpan * 1 + 1;
					}else{
						x[0].colSpan = x[0].colSpan;
						$("#report-table thead tr th:eq(0)").show();
					}
				}
				$scope.viewModel.checkbox10 = !$scope.viewModel.checkbox10;
				if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
					$("#report-table thead tr th:eq(0)").hide();
				}else{
					$("#report-table thead tr th:eq(0)").show();
				}
			}
			if(type == 11){
				if($scope.viewModel.checkbox11 == true){
					x[1].colSpan = x[1].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox11 == true){
						x[1].colSpan = x[1].colSpan * 1 + 1;
					}else{
						x[1].colSpan = x[1].colSpan;
						$("#report-table thead tr th:eq(1)").show();
					}
				}
				$scope.viewModel.checkbox11 = !$scope.viewModel.checkbox11;
				if($scope.viewModel.checkbox11 == false){
					$("#report-table thead tr th:eq(1)").hide();
				}else{
					$("#report-table thead tr th:eq(1)").show();
				}
			}
//			if(type == 12){
//				if($scope.viewModel.checkbox12 == true){
//					x[1].colSpan = x[1].colSpan - 1;
//				}else{
//					if($scope.viewModel.checkbox11 == true || $scope.viewModel.checkbox12 == true){
//						x[1].colSpan = x[1].colSpan * 1 + 1;
//					}else{
//						x[1].colSpan = x[1].colSpan;
//						$("#report-table thead tr th:eq(1)").show();
//					}
//				}
//				$scope.viewModel.checkbox12 = !$scope.viewModel.checkbox12;
//				if($scope.viewModel.checkbox11 == false && $scope.viewModel.checkbox12 == false){
//					$("#report-table thead tr th:eq(1)").hide();
//				}else{
//					$("#report-table thead tr th:eq(1)").show();
//				}
//			}
			if(type == 13){
				if($scope.viewModel.checkbox13 == true){
					x[2].colSpan = x[2].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox13 == true || $scope.viewModel.checkbox15 == true ||  $scope.viewModel.checkbox17 == true || $scope.viewModel.checkbox171 == true){
						x[2].colSpan = x[2].colSpan * 1 + 1;
					}else{
						x[2].colSpan = x[2].colSpan;
						$("#report-table thead tr th:eq(2)").show();
					}
				}
				$scope.viewModel.checkbox13 = !$scope.viewModel.checkbox13;
				if($scope.viewModel.checkbox13 == false && $scope.viewModel.checkbox14 == false && $scope.viewModel.checkbox15 == false && $scope.viewModel.checkbox16 == false && $scope.viewModel.checkbox17 == false && $scope.viewModel.checkbox171 == false){
					$("#report-table thead tr th:eq(2)").hide();
				}else{
					$("#report-table thead tr th:eq(2)").show();
				}
			}
//			if(type == 14){
//				if($scope.viewModel.checkbox14 == true){
//					x[2].colSpan = x[2].colSpan - 1;
//				}else{
//					if($scope.viewModel.checkbox13 == true || $scope.viewModel.checkbox14 == true || $scope.viewModel.checkbox15 == true || $scope.viewModel.checkbox16 == true || $scope.viewModel.checkbox17 == true || $scope.viewModel.checkbox171 == true){
//						x[2].colSpan = x[2].colSpan * 1 + 1;
//					}else{
//						x[2].colSpan = x[2].colSpan;
//						$("#report-table thead tr th:eq(2)").show();
//					}
//				}
//				$scope.viewModel.checkbox14 = !$scope.viewModel.checkbox14;
//				if($scope.viewModel.checkbox13 == false && $scope.viewModel.checkbox14 == false && $scope.viewModel.checkbox15 == false && $scope.viewModel.checkbox16 == false && $scope.viewModel.checkbox17 == false && $scope.viewModel.checkbox171 == false){
//					$("#report-table thead tr th:eq(2)").hide();
//				}else{
//					$("#report-table thead tr th:eq(2)").show();
//				}
//			}
			if(type == 15){
				if($scope.viewModel.checkbox15 == true){
					x[2].colSpan = x[2].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox13 == true || $scope.viewModel.checkbox15 == true ||  $scope.viewModel.checkbox17 == true || $scope.viewModel.checkbox171 == true){
						x[2].colSpan = x[2].colSpan * 1 + 1;
					}else{
						x[2].colSpan = x[2].colSpan;
						$("#report-table thead tr th:eq(2)").show();
					}
				}
				$scope.viewModel.checkbox15 = !$scope.viewModel.checkbox15;
				if($scope.viewModel.checkbox13 == false && $scope.viewModel.checkbox15 == false && $scope.viewModel.checkbox17 == false && $scope.viewModel.checkbox171 == false){
					$("#report-table thead tr th:eq(2)").hide();
				}else{
					$("#report-table thead tr th:eq(2)").show();
				}
			}
//			if(type == 16){
//				if($scope.viewModel.checkbox16 == true){
//					x[2].colSpan = x[2].colSpan - 1;
//				}else{
//					if($scope.viewModel.checkbox13 == true || $scope.viewModel.checkbox14 == true || $scope.viewModel.checkbox15 == true || $scope.viewModel.checkbox16 == true || $scope.viewModel.checkbox17 == true || $scope.viewModel.checkbox171 == true){
//						x[2].colSpan = x[2].colSpan * 1 + 1;
//					}else{
//						x[2].colSpan = x[2].colSpan;
//						$("#report-table thead tr th:eq(2)").show();
//					}
//				}
//				$scope.viewModel.checkbox16 = !$scope.viewModel.checkbox16;
//				if($scope.viewModel.checkbox13 == false && $scope.viewModel.checkbox14 == false && $scope.viewModel.checkbox15 == false && $scope.viewModel.checkbox16 == false && $scope.viewModel.checkbox17 == false && $scope.viewModel.checkbox171 == false){
//					$("#report-table thead tr th:eq(2)").hide();
//				}else{
//					$("#report-table thead tr th:eq(2)").show();
//				}
//			}
			if(type == 17){
				if($scope.viewModel.checkbox17 == true){
					x[2].colSpan = x[2].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox13 == true || $scope.viewModel.checkbox15 == true ||  $scope.viewModel.checkbox17 == true || $scope.viewModel.checkbox171 == true){
						x[2].colSpan = x[2].colSpan * 1 + 1;
					}else{
						x[2].colSpan = x[2].colSpan;
						$("#report-table thead tr th:eq(2)").show();
					}
				}
				$scope.viewModel.checkbox17 = !$scope.viewModel.checkbox17;
				if($scope.viewModel.checkbox13 == false && $scope.viewModel.checkbox15 == false && $scope.viewModel.checkbox17 == false && $scope.viewModel.checkbox171 == false){
					$("#report-table thead tr th:eq(2)").hide();
				}else{
					$("#report-table thead tr th:eq(2)").show();
				}
			}
			if(type == 171){
				if($scope.viewModel.checkbox171 == true){
					x[2].colSpan = x[2].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox13 == true || $scope.viewModel.checkbox15 == true ||  $scope.viewModel.checkbox17 == true || $scope.viewModel.checkbox171 == true){
						x[2].colSpan = x[2].colSpan * 1 + 1;
					}else{
						x[2].colSpan = x[2].colSpan;
						$("#report-table thead tr th:eq(2)").show();
					}
				}
				$scope.viewModel.checkbox171 = !$scope.viewModel.checkbox171;
				if($scope.viewModel.checkbox13 == false && $scope.viewModel.checkbox15 == false && $scope.viewModel.checkbox17 == false && $scope.viewModel.checkbox171 == false){
					$("#report-table thead tr th:eq(2)").hide();
				}else{
					$("#report-table thead tr th:eq(2)").show();
				}
			}
			if(type == 18){
				if($scope.viewModel.checkbox18 == true){
					x[3].colSpan = x[3].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox18 == true || $scope.viewModel.checkbox19 == true || $scope.viewModel.checkbox20 == true){
						x[3].colSpan = x[3].colSpan * 1 + 1;
					}else{
						x[3].colSpan = x[3].colSpan;
						$("#report-table thead tr th:eq(3)").show();
					}
				}
				$scope.viewModel.checkbox18 = !$scope.viewModel.checkbox18;
				if($scope.viewModel.checkbox18 == false && $scope.viewModel.checkbox19 == false && $scope.viewModel.checkbox20 == false){
					$("#report-table thead tr th:eq(3)").hide();
				}else{
					$("#report-table thead tr th:eq(3)").show();
				}
			}
			if(type == 19){
				if($scope.viewModel.checkbox19 == true){
					x[3].colSpan = x[3].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox18 == true || $scope.viewModel.checkbox19 == true || $scope.viewModel.checkbox20 == true){
						x[3].colSpan = x[3].colSpan * 1 + 1;
					}else{
						x[3].colSpan = x[3].colSpan;
						$("#report-table thead tr th:eq(3)").show();
					}
				}
				$scope.viewModel.checkbox19 = !$scope.viewModel.checkbox19;
				if($scope.viewModel.checkbox18 == false && $scope.viewModel.checkbox19 == false && $scope.viewModel.checkbox20 == false){
					$("#report-table thead tr th:eq(3)").hide();
				}else{
					$("#report-table thead tr th:eq(3)").show();
				}
			}
			if(type == 20){
				if($scope.viewModel.checkbox20 == true){
					x[3].colSpan = x[3].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox18 == true || $scope.viewModel.checkbox19 == true || $scope.viewModel.checkbox20 == true){
						x[3].colSpan = x[3].colSpan * 1 + 1;
					}else{
						x[3].colSpan = x[3].colSpan;
						$("#report-table thead tr th:eq(3)").show();
					}
				}
				$scope.viewModel.checkbox20 = !$scope.viewModel.checkbox20;
				if($scope.viewModel.checkbox18 == false && $scope.viewModel.checkbox19 == false && $scope.viewModel.checkbox20 == false){
					$("#report-table thead tr th:eq(3)").hide();
				}else{
					$("#report-table thead tr th:eq(3)").show();
				}
			}
			if(type == 21){
				if($scope.viewModel.checkbox21 == true){
					x[4].colSpan = x[4].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox21 == true || $scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true){
						x[4].colSpan = x[4].colSpan * 1 + 1;
					}else{
						x[4].colSpan = x[4].colSpan;
						$("#report-table thead tr th:eq(4)").show();
					}
				}
				$scope.viewModel.checkbox21 = !$scope.viewModel.checkbox21;
				if($scope.viewModel.checkbox21 == false && $scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25 == false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false){
					$("#report-table thead tr th:eq(4)").hide();
				}else{
					$("#report-table thead tr th:eq(4)").show();
				}
			}
			if(type == 22){
				if($scope.viewModel.checkbox22 == true){
					x[4].colSpan = x[4].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox21 == true || $scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true){
						x[4].colSpan = x[4].colSpan * 1 + 1;
					}else{
						x[4].colSpan = x[4].colSpan;
						$("#report-table thead tr th:eq(4)").show();
					}
				}
				$scope.viewModel.checkbox22 = !$scope.viewModel.checkbox22;
				if($scope.viewModel.checkbox21 == false && $scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25 == false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false){
					$("#report-table thead tr th:eq(4)").hide();
				}else{
					$("#report-table thead tr th:eq(4)").show();
				}
			}
			if(type == 23){
				if($scope.viewModel.checkbox23 == true){
					x[4].colSpan = x[4].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox21 == true || $scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true){
						x[4].colSpan = x[4].colSpan * 1 + 1;
					}else{
						x[4].colSpan = x[4].colSpan;
						$("#report-table thead tr th:eq(4)").show();
					}
				}
				$scope.viewModel.checkbox23 = !$scope.viewModel.checkbox23;
				if($scope.viewModel.checkbox21 == false && $scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25 == false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false){
					$("#report-table thead tr th:eq(4)").hide();
				}else{
					$("#report-table thead tr th:eq(4)").show();
				}
			}
			if(type == 24){
				if($scope.viewModel.checkbox24 == true){
					x[4].colSpan = x[4].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox21 == true || $scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true){
						x[4].colSpan = x[4].colSpan * 1 + 1;
					}else{
						x[4].colSpan = x[4].colSpan;
						$("#report-table thead tr th:eq(4)").show();
					}
				}
				$scope.viewModel.checkbox24 = !$scope.viewModel.checkbox24;
				if($scope.viewModel.checkbox21 == false && $scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25 == false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false){
					$("#report-table thead tr th:eq(4)").hide();
				}else{
					$("#report-table thead tr th:eq(4)").show();
				}
			}
			if(type == 25){
				if($scope.viewModel.checkbox25 == true){
					x[4].colSpan = x[4].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox21 == true || $scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true){
						x[4].colSpan = x[4].colSpan * 1 + 1;
					}else{
						x[4].colSpan = x[4].colSpan;
						$("#report-table thead tr th:eq(4)").show();
					}
				}
				$scope.viewModel.checkbox25 = !$scope.viewModel.checkbox25;
				if($scope.viewModel.checkbox21 == false && $scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25 == false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false){
					$("#report-table thead tr th:eq(4)").hide();
				}else{
					$("#report-table thead tr th:eq(4)").show();
				}
			}
			if(type == 26){
				if($scope.viewModel.checkbox26 == true){
					x[4].colSpan = x[4].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox21 == true || $scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true){
						x[4].colSpan = x[4].colSpan * 1 + 1;
					}else{
						x[4].colSpan = x[4].colSpan;
						$("#report-table thead tr th:eq(4)").show();
					}
				}
				$scope.viewModel.checkbox26 = !$scope.viewModel.checkbox26;
				if($scope.viewModel.checkbox21 == false && $scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25 == false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false){
					$("#report-table thead tr th:eq(4)").hide();
				}else{
					$("#report-table thead tr th:eq(4)").show();
				}
			}
			if(type == 27){
				if($scope.viewModel.checkbox27 == true){
					x[4].colSpan = x[4].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox21 == true || $scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true){
						x[4].colSpan = x[4].colSpan * 1 + 1;
					}else{
						x[4].colSpan = x[4].colSpan;
						$("#report-table thead tr th:eq(4)").show();
					}
				}
				$scope.viewModel.checkbox27 = !$scope.viewModel.checkbox27;
				if($scope.viewModel.checkbox21 == false && $scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25 == false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false){
					$("#report-table thead tr th:eq(4)").hide();
				}else{
					$("#report-table thead tr th:eq(4)").show();
				}
			}
			if(type == 28){
				if($scope.viewModel.checkbox28 == true){
					x[4].colSpan = x[4].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox21 == true || $scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true){
						x[4].colSpan = x[4].colSpan * 1 + 1;
					}else{
						x[4].colSpan = x[4].colSpan;
						$("#report-table thead tr th:eq(4)").show();
					}
				}
				$scope.viewModel.checkbox28 = !$scope.viewModel.checkbox28;
				if($scope.viewModel.checkbox21 == false && $scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25 == false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false){
					$("#report-table thead tr th:eq(4)").hide();
				}else{
					$("#report-table thead tr th:eq(4)").show();
				}
			}
			if(type == 29){
				if($scope.viewModel.checkbox29 == true){
					x[4].colSpan = x[4].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox21 == true || $scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true){
						x[4].colSpan = x[4].colSpan * 1 + 1;
					}else{
						x[4].colSpan = x[4].colSpan;
						$("#report-table thead tr th:eq(4)").show();
					}
				}
				$scope.viewModel.checkbox29 = !$scope.viewModel.checkbox29;
				if($scope.viewModel.checkbox21 == false && $scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25 == false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false){
					$("#report-table thead tr th:eq(4)").hide();
				}else{
					$("#report-table thead tr th:eq(4)").show();
				}
			}
			if(type == 30){
				if($scope.viewModel.checkbox30 == true){
					x[4].colSpan = x[4].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox21 == true || $scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true){
						x[4].colSpan = x[4].colSpan * 1 + 1;
					}else{
						x[4].colSpan = x[4].colSpan;
						$("#report-table thead tr th:eq(4)").show();
					}
				}
				$scope.viewModel.checkbox30 = !$scope.viewModel.checkbox30;
				if($scope.viewModel.checkbox21 == false && $scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25 == false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false){
					$("#report-table thead tr th:eq(4)").hide();
				}else{
					$("#report-table thead tr th:eq(4)").show();
				}
			}
			if(type == 31){
				if($scope.viewModel.checkbox31 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox31 = !$scope.viewModel.checkbox31;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 32){
				if($scope.viewModel.checkbox32 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox32 = !$scope.viewModel.checkbox32;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 33){
				if($scope.viewModel.checkbox33 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox33 = !$scope.viewModel.checkbox33;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 34){
				if($scope.viewModel.checkbox34 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox34 = !$scope.viewModel.checkbox34;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 35){
				if($scope.viewModel.checkbox35 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox35 = !$scope.viewModel.checkbox35;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 36){
				if($scope.viewModel.checkbox36 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox36 = !$scope.viewModel.checkbox36;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 37){
				if($scope.viewModel.checkbox37 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox37 = !$scope.viewModel.checkbox37;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 38){
				if($scope.viewModel.checkbox38 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox38 = !$scope.viewModel.checkbox38;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 39){
				if($scope.viewModel.checkbox39 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox39 = !$scope.viewModel.checkbox39;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 40){
				if($scope.viewModel.checkbox40 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox40 = !$scope.viewModel.checkbox40;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 41){
				if($scope.viewModel.checkbox41 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox41 = !$scope.viewModel.checkbox41;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 42){
				if($scope.viewModel.checkbox42 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox42 = !$scope.viewModel.checkbox42;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 43){
				if($scope.viewModel.checkbox43 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox43 = !$scope.viewModel.checkbox43;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 44){
				if($scope.viewModel.checkbox44 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox44 = !$scope.viewModel.checkbox44;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 45){
				if($scope.viewModel.checkbox45 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox45 = !$scope.viewModel.checkbox45;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 46){
				if($scope.viewModel.checkbox46 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox46 = !$scope.viewModel.checkbox46;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 47){
				if($scope.viewModel.checkbox47 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox47 = !$scope.viewModel.checkbox47;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 48){
				if($scope.viewModel.checkbox48 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox48 = !$scope.viewModel.checkbox48;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 49){
				if($scope.viewModel.checkbox49 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox49 = !$scope.viewModel.checkbox49;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 50){
				if($scope.viewModel.checkbox50 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox50 = !$scope.viewModel.checkbox50;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 51){
				if($scope.viewModel.checkbox51 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox51 = !$scope.viewModel.checkbox51;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 52){
				if($scope.viewModel.checkbox52 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox52 = !$scope.viewModel.checkbox52;
				if($scope.viewModel.checkbox31 == true 
						|| $scope.viewModel.checkbox32 == true 
						|| $scope.viewModel.checkbox33 == true 
						|| $scope.viewModel.checkbox34 == true 
						|| $scope.viewModel.checkbox35 == true 
						|| $scope.viewModel.checkbox36 == true 
						|| $scope.viewModel.checkbox37 == true 
						|| $scope.viewModel.checkbox38 == true 
						|| $scope.viewModel.checkbox39 == true 
						|| $scope.viewModel.checkbox40 == true 
						|| $scope.viewModel.checkbox41 == true 
						|| $scope.viewModel.checkbox42 == true 
						|| $scope.viewModel.checkbox43 == true 
						|| $scope.viewModel.checkbox44 == true 
						|| $scope.viewModel.checkbox45 == true 
						|| $scope.viewModel.checkbox46 == true 
						|| $scope.viewModel.checkbox47 == true 
						|| $scope.viewModel.checkbox48 == true 
						|| $scope.viewModel.checkbox49 == true 
						|| $scope.viewModel.checkbox50 == true 
						|| $scope.viewModel.checkbox51 == true 
						|| $scope.viewModel.checkbox52 == true
						|| $scope.viewModel.checkbox53 == true
						|| $scope.viewModel.checkbox54 == true){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 53){
				if($scope.viewModel.checkbox53 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox53 = !$scope.viewModel.checkbox53;
				if($scope.viewModel.checkbox31 == false 
						&& $scope.viewModel.checkbox32 == false 
						&& $scope.viewModel.checkbox33 == false 
						&& $scope.viewModel.checkbox34 == false 
						&& $scope.viewModel.checkbox35 == false 
						&& $scope.viewModel.checkbox36 == false 
						&& $scope.viewModel.checkbox37 == false 
						&& $scope.viewModel.checkbox38 == false 
						&& $scope.viewModel.checkbox39 == false 
						&& $scope.viewModel.checkbox40 == false 
						&& $scope.viewModel.checkbox41 == false 
						&& $scope.viewModel.checkbox42 == false 
						&& $scope.viewModel.checkbox43 == false 
						&& $scope.viewModel.checkbox44 == false 
						&& $scope.viewModel.checkbox45 == false 
						&& $scope.viewModel.checkbox46 == false 
						&& $scope.viewModel.checkbox47 == false 
						&& $scope.viewModel.checkbox48 == false 
						&& $scope.viewModel.checkbox49 == false 
						&& $scope.viewModel.checkbox50 == false 
						&& $scope.viewModel.checkbox51 == false 
						&& $scope.viewModel.checkbox52 == false
						&& $scope.viewModel.checkbox53 == false
						&& $scope.viewModel.checkbox54 == false){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 54){
				if($scope.viewModel.checkbox54 == true){
					x[5].colSpan = x[5].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox31 == true 
							|| $scope.viewModel.checkbox32 == true 
							|| $scope.viewModel.checkbox33 == true 
							|| $scope.viewModel.checkbox34 == true 
							|| $scope.viewModel.checkbox35 == true 
							|| $scope.viewModel.checkbox36 == true 
							|| $scope.viewModel.checkbox37 == true 
							|| $scope.viewModel.checkbox38 == true 
							|| $scope.viewModel.checkbox39 == true 
							|| $scope.viewModel.checkbox40 == true 
							|| $scope.viewModel.checkbox41 == true 
							|| $scope.viewModel.checkbox42 == true 
							|| $scope.viewModel.checkbox43 == true 
							|| $scope.viewModel.checkbox44 == true 
							|| $scope.viewModel.checkbox45 == true 
							|| $scope.viewModel.checkbox46 == true 
							|| $scope.viewModel.checkbox47 == true 
							|| $scope.viewModel.checkbox48 == true 
							|| $scope.viewModel.checkbox49 == true 
							|| $scope.viewModel.checkbox50 == true 
							|| $scope.viewModel.checkbox51 == true 
							|| $scope.viewModel.checkbox52 == true
							|| $scope.viewModel.checkbox53 == true
							|| $scope.viewModel.checkbox54 == true){
						x[5].colSpan = x[5].colSpan * 1 + 1;
					}else{
						x[5].colSpan = x[5].colSpan;
						$("#report-table thead tr th:eq(5)").show();
					}
				}
				$scope.viewModel.checkbox54 = !$scope.viewModel.checkbox54;
				if($scope.viewModel.checkbox31 == false 
						&& $scope.viewModel.checkbox32 == false 
						&& $scope.viewModel.checkbox33 == false 
						&& $scope.viewModel.checkbox34 == false 
						&& $scope.viewModel.checkbox35 == false 
						&& $scope.viewModel.checkbox36 == false 
						&& $scope.viewModel.checkbox37 == false 
						&& $scope.viewModel.checkbox38 == false 
						&& $scope.viewModel.checkbox39 == false 
						&& $scope.viewModel.checkbox40 == false 
						&& $scope.viewModel.checkbox41 == false 
						&& $scope.viewModel.checkbox42 == false 
						&& $scope.viewModel.checkbox43 == false 
						&& $scope.viewModel.checkbox44 == false 
						&& $scope.viewModel.checkbox45 == false 
						&& $scope.viewModel.checkbox46 == false 
						&& $scope.viewModel.checkbox47 == false 
						&& $scope.viewModel.checkbox48 == false 
						&& $scope.viewModel.checkbox49 == false 
						&& $scope.viewModel.checkbox50 == false 
						&& $scope.viewModel.checkbox51 == false 
						&& $scope.viewModel.checkbox52 == false
						&& $scope.viewModel.checkbox53 == false
						&& $scope.viewModel.checkbox54 == false){
					$("#report-table thead tr th:eq(5)").hide();
				}else{
					$("#report-table thead tr th:eq(5)").show();
				}
			}
			if(type == 55){
				if($scope.viewModel.checkbox55 == true){
					x[6].colSpan = x[6].colSpan - 1;
				}else{
					if($scope.viewModel.checkbox55 == true){
						x[6].colSpan = x[6].colSpan * 1 + 1;
					}else{
						x[6].colSpan = x[6].colSpan;
						$("#report-table thead tr th:eq(6)").show();
					}
				}
				$scope.viewModel.checkbox55 = !$scope.viewModel.checkbox55;
				if($scope.viewModel.checkbox55 == false){
					$("#report-table thead tr th:eq(6)").hide();
				}else{
					$("#report-table thead tr th:eq(6)").show();
				}
			}
		}
} ]);